module demo{
    export class Module extends ModuleBase
    {

        public modulePreStart():void
        {
            super.modulePreStart();
            let back:GYLite.GYUIComponent = new GYLite.GYUIComponent;
            let s= this;
            let g:egret.Graphics = back.graphics;
            let w:number,h:number;
            w = s.width;
            h = s.height;
            g.beginFill(0,1);
            g.drawRect(0,0,w,h);
            g.endFill();
            s.addChild(back);
            back.width = w;
            back.height = h;
            let btn:GYLite.GYButton;
            btn = new GYLite.GYButton;
            btn.width = 300;
            btn.height = 300;
            btn.label = "请点击我";
            btn.labelDisplay.size = 60;
            btn.horizonalCenter = 0;
            btn.verticalCenter = 0;
            back.addElement(btn);
            btn.setOnClick(function(e:egret.TouchEvent):void{
                let txt:GYLite.GYText = new GYLite.GYText;
                txt.width = s.stage.stageWidth;
                txt.height = 65;
                txt.size = 60;
                txt.verticalCenter = -60;
                txt.horizonalCenter = 0;
                txt.align = "center"
                txt.color = 0xffffff;
                txt.text = "欢迎使用羔羊引擎的模块化项目!"
                back.addElement(txt);
                back.removeElement(btn);
            },s);
        }
    }
}